
import Layout from '@/pages/index'
import pageView from '@/pages/Layout/Layout'
import store from '@/store'

export const view = [
  /*{
    path: '',
    meta: {
      menuId: 'home',
      menuTitle: '首页'
    },
    children: [
      {
        title: '页面一',
        path: '/page1',
        id: 'page1',
        component: () => import('@/pages/page1/page1'),
        meta: {
          isMenu: true,
          menuTitle: '页面一',
          menuId: 'page1',
          tabId: 'page1',
          tabTitle: '页面一'
        }
      }
    ]
  },*/

  {
    path: '/dataBoard',
    component: () => import('@/pages/DataBoard/DataBoard'),
    meta: {
      hasAuth: true,
      isMenu: true,
      menuTitle: '首页',
      menuId: 'dataBoard',
      tabId: 'dataBoard',
      tabTitle: '首页'
    }
  },
  {
    path: '',
    meta: {
      menuId: 'shuttle',
      menuTitle: '班车业务'
    },
    children: [
      {
        path: '/schoolList',
        component: () => import('@/pages/School/SchoolList'),
        meta: {
          isMenu: true,
          menuTitle: '站点(讫地)列表',
          menuId: 'schoolList',
          tabId: 'schoolList',
          tabTitle: '站点(讫地)列表',
          parentPath: 'shuttle',
          auth_id: 'school',
        }

      },
      {
        path: '/siteList',
        component: () => import('@/pages/Site/SiteList'),
        meta: {
          isMenu: true,
          menuTitle: '站点列表',
          menuId: 'siteList',
          tabId: 'siteList',
          tabTitle: '站点列表',
          parentPath: 'shuttle',
          auth_id: 'stop',
        }
      },
      {
        path: '/ticketPackageLabel',
        component: () => import('@/pages/TicketPackageLabel/TicketPackageLabel'),
        meta: {

          isMenu: true,
          menuTitle: '套票标签',
          menuId: 'ticketPackageLabel',
          tabId: 'ticketPackageLabel',
          tabTitle: '套票标签',
          parentPath: 'shuttle',
          auth_id: 'ticketPackageLabel',
        }

      },
      {
        path: '/shuttleList',
        component: () => import('@/pages/Shuttle/ShuttleList'),
        meta: {
          isMenu: true,
          menuTitle: '班车列表',
          menuId: 'shuttleList',
          parMenuId: 'shuttle',
          tabId: 'shuttleList',
          tabTitle: '班车列表',
          auth_id: 'shuttle',
        }
      },
      {
        path: '/shuttleList_xinban',
        component: () => import('@/pages/Shuttle/ShuttleList_xinban'),
        meta: {
          isMenu: true,
          menuTitle: '班车模版列表',
          menuId: 'shuttleList_xinban',
          parMenuId: 'shuttle',
          tabId: 'shuttleList_xinban',
          tabTitle: '班车模版列表',
          auth_id: 'shuttle',
        }

      },
      {
        path: '/shuttleDetail/:id',
        name: 'shuttleDetail',
        component: () => import('@/pages/Shuttle/ShuttleDetail'),
        meta: {
          isMenu: false,
          // menuTitle: '班车详情',
          // menuId: 'shuttleDetail',
          parMenuId: 'shuttle',
          tabId: 'shuttleDetail',
          tabTitle: '班车详情',
          auth_id: 'shuttle',
        }
      },
      {
        path: '/shuttleSeat',
        component: () => import('@/pages/ShuttleSeat/ShuttleSeat'),
        meta: {
          isMenu: true,
          menuTitle: '班车座位',
          menuId: 'shuttleSeat',
          parMenuId: 'shuttle',
          tabId: 'shuttleSeat',
          tabTitle: '班车座位'
        }
      },
      /*{
        path: '/shuttleNew',
        component: () => import('@/pages/Shuttle/ShuttleNew'),
        meta: {
          isMenu: true,
          menuTitle: '新建班车',
          menuId: 'shuttleNew',
          parMenuId: 'shuttle',
          tabId: 'shuttleNew',
          tabTitle: '新建班车'
        }
      },*/

      /*{
        path: '/shuttlePackage',
        component: () => import('@/pages/ShuttlePackage/ShuttlePackage'),
        meta: {
          isMenu: true,
          menuTitle: '班车套票',
          menuId: 'shuttlePackage',
          parMenuId: 'shuttle',
          tabId: 'shuttlePackage',
          tabTitle: '班车套票'
        }
      },
      {
        path: '/shuttleStop',
        component: () => import('@/pages/ShuttleStop/ShuttleStop'),
        meta: {
          isMenu: true,
          menuTitle: '班车站点',
          menuId: 'shuttleStop',
          parMenuId: 'shuttle',
          tabId: 'shuttleStop',
          tabTitle: '班车站点'
        }
      },

      {
        path: '/shuttleSchool',
        component: () => import('@/pages/ShuttleSchool/ShuttleSchool'),
        meta: {
          isMenu: true,
          menuTitle: '班车站点',
          menuId: 'shuttleSchool',
          parMenuId: 'shuttle',
          tabId: 'shuttleSchool',
          tabTitle: '班车站点'
        }
      },*/
    ]
  },
  {
    path: '/order',
    component: () => import('@/pages/Order/OrderList'),
    meta: {
      isMenu: true,
      menuTitle: '订单管理',
      menuId: 'order',
      tabId: 'order',
      tabTitle: '订单管理',
      auth_id: 'order',
    }

  },
  {
    path: '/customer',
    component: () => import('@/pages/Customer/Customer'),
    meta: {
      isMenu: true,
      menuTitle: '客户管理',
      menuId: 'customer',
      tabId: 'customer',
      tabTitle: '客户管理',
      parentPath: 'client',
      auth_id: 'customer',
    }

  },
  {
    path: '/passenger',
    component: () => import('@/pages/Passenger/Passenger'),
    meta: {
      isMenu: false,
      menuId: 'customer',
      tabId: 'customer',
      tabTitle: '客户管理',
      parentPath: 'client',
      auth_id: 'passengers',
    }

  },
  {
    path: '',
    meta: {
      menuId: 'afterPay',
      menuTitle: '后支付管理',
    },
    children: [
      {
        path: '/afterPayment',
        component: () => import('@/pages/AfterPay/AfterPay'),
        meta: {
          isMenu: true,
          menuTitle: '后支付订单',
          menuId: 'afterPayment',
          tabId: 'afterPayment',
          tabTitle: '后支付订单',
          parentPath: 'afterPay',
          auth_id: 'after_payment',
        }
      },
      {
        path: '/afterPayStatistics',
        component: () => import('@/pages/AfterPayStatistics/AfterPayStatistics'),
        meta: {
          isMenu: true,
          menuTitle: '后支付报表',
          menuId: 'afterPayStatistics',
          tabId: 'afterPayStatistics',
          tabTitle: '后支付报表',
          parentPath: 'afterPay',
          auth_id: '',
        }
      },
      {
        path: '/afterPaySchool',
        component: () => import('@/pages/AfterPaySchool/AfterPaySchool'),
        meta: {
          isMenu: true,
          menuTitle: '后支付站点',
          menuId: 'afterPaySchool',
          tabId: 'afterPaySchool',
          tabTitle: '后支付站点',
          parentPath: 'afterPay',
          auth_id: '',
        }
      },
    ]
  },
  {
    path: '/leaveRegistration',
    component: () => import('@/pages/LeaveRegistration/LeaveRegistration'),
    meta: {
      isMenu: true,
      menuTitle: '请假登记',
      menuId: 'leaveRegistration',
      tabId: 'leaveRegistration',
      tabTitle: '请假登记',
      auth_id: '',
    }

  },
  {
    path: '',
    meta: {
      menuId: 'basic',
      menuTitle: '基础数据'
    },
    children: [
      {
        path: '/agreement',
        component: () => import('@/pages/Agreement/Agreement'),
        meta: {
          isMenu: true,
          menuTitle: '协议列表',
          menuId: 'agreement',
          tabId: 'agreement',
          tabTitle: '协议列表',
          parentPath: 'basic',
          auth_id: 'agreement',
        }

      },
      {
        path: '/identificationType',
        component: () => import('@/pages/IdentificationType/IdentificationTypeList'),
        meta: {
          isMenu: true,
          menuTitle: '证件类型',
          menuId: 'identificationType',
          tabId: 'identificationType',
          tabTitle: '证件类型',
          parentPath: 'basic',
          auth_id: 'identificationType',
        }

      },
      {
        path: '/leaveSchoolType',
        component: () => import('@/pages/LeaveSchoolType/LeaveSchoolType'),
        meta: {
          isMenu: true,
          menuTitle: '下车接送方式',
          menuId: 'leaveSchoolType',
          tabId: 'leaveSchoolType',
          tabTitle: '下车接送方式',
          parentPath: 'basic',
          auth_id: 'leaveSchoolType',
        }
      },
      {
        path: '/seatStatus',
        component: () => import('@/pages/SeatStatus/SeatStatus'),
        meta: {
          isMenu: true,
          menuTitle: '座位状态',
          menuId: 'seatStatus',
          tabId: 'seatStatus',
          tabTitle: '座位状态',
          parentPath: 'basic',
          auth_id: 'seatStatus',
        }
      },
      {
        path: '/operationGroup',
        component: () => import('@/pages/OperationGroup/OperationGroup'),
        meta: {
          isMenu: true,
          menuTitle: '营运组',
          menuId: 'operationGroup',
          tabId: 'operationGroup',
          tabTitle: '营运组',
          parentPath: 'basic',
          auth_id: 'operation',
        }
      },

      {
        path: '/schoolType',
        component: () => import('@/pages/SchoolType/SchoolTypeList'),
        meta: {

          isMenu: true,
          menuTitle: '站点(讫地)类型',
          menuId: 'schoolType',
          tabId: 'schoolType',
          tabTitle: '站点(讫地)类型',
          parentPath: 'basic',
          auth_id: 'schoolType',
        }

      },
      {
        path: '/ticketPackageType',
        component: () => import('@/pages/TicketPackageType/TicketPackageType'),
        meta: {
          isMenu: true,
          menuTitle: '套票类型',
          menuId: 'ticketPackageType',
          tabId: 'ticketPackageType',
          tabTitle: '套票类型',
          parentPath: 'basic',
          auth_id: 'ticketPackageType',
        }
      },
      {
        path: '/ticketType',
        component: () => import('@/pages/TicketType/TicketType'),
        meta: {

          isMenu: true,
          menuTitle: '车票类型',
          menuId: 'ticketType',
          tabId: 'ticketType',
          tabTitle: '车票类型',
          parentPath: 'basic',
          auth_id: 'ticketType',
        }

      },
      {
        path: '/shuttleDirection',
        component: () => import('@/pages/ShuttleDirection/ShuttleDirectionList'),
        meta: {
          isMenu: true,
          menuTitle: '班车方向',
          menuId: 'shuttleDirection',
          parMenuId: 'basic',
          tabId: 'shuttleDirection',
          tabTitle: '班车方向',
          auth_id: 'shuttleDirection',
        }

      },
      {
        path: '/priorityTicket',
        component: () => import('@/pages/PriorityTicket/PriorityTicket'),
        meta: {
          isMenu: true,
          menuTitle: '优先购票名单',
          menuId: 'priorityTicket',
          parMenuId: 'basic',
          tabId: 'priorityTicket',
          tabTitle: '优先购票名单',
          auth_id: 'EPriorityPassengers',
        }

      },

    ]
  },
  {
    path: '',
    meta: {
      menuId: 'sys',
      menuTitle: '系统数据'
    },
    children: [
      {
        path: '/parameterList',
        component: () => import('@/pages/Parameter/ParameterList'),
        meta: {
          isMenu: true,
          menuTitle: '系统参数',
          menuId: 'parameterList',
          tabId: 'parameterList',
          tabTitle: '系统参数',
          parentPath: 'sys',
          auth_id: 'parameter',
        }

      },
      {
        path: '/employeeInf',
        component: () => import('@/pages/EmployeeInf/EmployeeInf'),
        meta: {
          isMenu: true,
          menuTitle: '员工管理',
          menuId: 'employeeInf',
          tabId: 'employeeInf',
          tabTitle: '员工管理',
          parentPath: 'sys',
          auth_id: 'employeeInf',
        }

      },
      {
        path: '/zhangtaohesuanquyu',
        component: () => import('@/pages/ZhangTaoHeSuanQuYu/ZhangTaoHeSuanQuYu'),
        meta: {
          isMenu: true,
          menuTitle: '账套核算区域',
          menuId: 'zhangtaohesuanquyu',
          tabId: 'zhangtaohesuanquyu',
          tabTitle: '账套核算区域',
          parentPath: 'sys',
          auth_id: 'zhangTaoHeSuanQuYu',
        }

      },
      {
        path: '/user',
        component: () => import('@/pages/User/UserList'),
        meta: {
          isMenu: true,
          menuTitle: '用户管理',
          menuId: 'user',
          tabId: 'user',
          tabTitle: '用户管理',
          parentPath: 'sys',
          auth_id: 'user',
        }

      },
      {
        path: '/role',
        component: () => import('@/pages/Role/RoleList'),
        meta: {
          isMenu: false,
          menuTitle: '角色管理',
          menuId: 'user',
          tabId: 'user',
          tabTitle: '用户管理',
          parentPath: 'sys',
          auth_id: 'role',
        }

      },
      {
        path: '/permission',
        component: () => import('@/pages/Permission/Permission'),
        meta: {
          isMenu: true,
          menuTitle: '角色权限',
          menuId: 'permission',
          tabId: 'permission',
          tabTitle: '角色权限',
          parentPath: 'sys',
          auth_id: 'permission',
        }

      },
      {
        path: '/department',
        component: () => import('@/pages/Department/Department'),
        meta: {
          isMenu: true,
          menuTitle: '公司架构',
          menuId: 'department',
          tabId: 'department',
          tabTitle: '公司架构',
          parentPath: 'sys',
          auth_id: 'department',
        }

      },

    ]
  },

  {
    path: '/check-ticket',
    component: () => import('@/pages/CheckTicket/CheckTicket'),
    meta: {
      isMenu: true,
      menuTitle: '检票数据',
      menuId: 'checkTicket',
      tabId: 'checkTicket',
      tabTitle: '检票数据',
    }

  },
  {
    path: '',
    meta: {
      menuId: 'faceManagement',
      menuTitle: '刷脸管理'
    },
    children: [
      {
        path: '/facescan',
        component: () => import('@/pages/FaceScan/FaceScan'),
        meta: {
          isMenu: true,
          menuTitle: '刷脸记录',
          menuId: 'facescan',
          tabId: 'facescan',
          tabTitle: '刷脸记录',
        }
      },
      {
        path: '/faceDB',
        component: () => import('@/pages/ALiYunFace/FaceDB'),
        meta: {
          isMenu: true,
          menuTitle: '人脸数据库',
          menuId: 'faceDB',
          tabId: 'faceDB',
          tabTitle: '人脸数据库',
        }
      },
      {
        path: '/faceEntity',
        component: () => import('@/pages/ALiYunFace/FaceEntity'),
        meta: {
          isMenu: true,
          menuTitle: '人脸样本',
          menuId: 'faceEntity',
          tabId: 'faceEntity',
          tabTitle: '人脸样本',
        }
      },
    ]

  },
  {
    path: '',
    meta: {
      menuId: 'rollCall',
      menuTitle: '点名管理'
    },
    children: [
      {
        path: '/rollcallBasicShuttle',
        component: () => import('@/pages/RollcallBasicShuttle/RollcallBasicShuttle'),
        meta: {
          isMenu: true,
          menuTitle: '班车基础点名信息',
          menuId: 'rollcallBasicShuttle',
          tabId: 'rollcallBasicShuttle',
          tabTitle: '班车基础点名信息',
          auth_id: 'all_rollcall_shuttle',
        }
      },
      {
        path: '/rollcallDailyShuttle',
        component: () => import('@/pages/RollcallDailyShuttle/RollcallDailyShuttle'),
        meta: {
          isMenu: true,
          menuTitle: '班车每日点名信息',
          menuId: 'rollcallDailyShuttle',
          tabId: 'rollcallDailyShuttle',
          tabTitle: '班车每日点名信息',
          auth_id: 'e_rollcall_shuttle',
        }
      },
      {
        path: '/rollcallDailyStatistics',
        component: () => import('@/pages/RollcallDailyStatistics/RollcallDailyStatistics'),
        meta: {
          isMenu: true,
          menuTitle: '班车点名情况统计',
          menuId: 'rollcallDailyStatistics',
          tabId: 'rollcallDailyStatistics',
          tabTitle: '班车点名情况统计',
          auth_id: '',
        }
      },
      {
        path: '/caretaker',
        component: () => import('@/pages/Caretaker/Caretaker'),
        meta: {
          isMenu: true,
          menuTitle: '照管员管理',
          menuId: 'caretaker',
          tabId: 'caretaker',
          tabTitle: '照管员管理',
          auth_id: '',
        }

      },
      {
        path: '/driver',
        component: () => import('@/pages/Driver/Driver'),
        meta: {
          isMenu: true,
          menuTitle: '司机管理',
          menuId: 'driver',
          tabId: 'driver',
          tabTitle: '司机管理',
          auth_id: '',
        }

      },
      {
        path: '/vehicle',
        component: () => import('@/pages/Vehicle/Vehicle'),
        meta: {
          isMenu: true,
          menuTitle: '车辆管理',
          menuId: 'vehicle',
          parMenuId: 'basic',
          tabId: 'vehicle',
          tabTitle: '车辆管理',
          auth_id: '',
        }

      },
      {
        path: '/rollCallAdmin',
        component: () => import('@/pages/RollCallAdmin/RollCallAdmin'),
        meta: {
          isMenu: true,
          menuTitle: '点名管理人信息',
          menuId: 'rollCallAdmin',
          tabId: 'rollCallAdmin',
          tabTitle: '点名管理人信息',
          auth_id: '',
        }

      },
      {
        path: '/rollcallWechatPush',
        component: () => import('@/pages/RollcallWechatPush/RollcallWechatPush'),
        meta: {
          isMenu: true,
          menuTitle: '点名微信推送',
          menuId: 'rollcallWechatPush',
          tabId: 'rollcallWechatPush',
          tabTitle: '点名微信推送',
          auth_id: '',
        }

      },
      /*{
        path: '/rollCallShuttleStop',
        component: () => import('@/pages/RollcallBasicShuttleStop/RollcallBasicShuttleStop'),
        meta: {
          isMenu: true,
          menuTitle: '班车基础点名站点',
          menuId: 'rollCallShuttleStop',
          tabId: 'rollCallShuttleStop',
          tabTitle: '班车基础点名站点',
          auth_id: '',
        }

      },*/
    ],
  },
  {
    // path: '/infomgt',
    path: '',
    meta: {
      menuId: 'infomgt',
      menuTitle: '推文管理'
    },
    children: [
      {
        path: '/articleTweet',
        name: 'articleTweet',
        component: () => import('@/pages/InfoManagement/ArticleTweet'),
        meta: {
          isMenu: true,
          menuTitle: '文章推文',
          menuId: 'articleTweet',
          tabId: 'articleTweet',
          tabTitle: '文章推文',
        },
      },
      {
        path: '/tmplmsg',
        name: 'tmplmsg',
        component: () => import('@/pages/InfoManagement/TemplateMessage'),
        meta: {
          isMenu: true,
          menuTitle: '模板消息',
          menuId: 'tmplmsg',
          tabId: 'tmplmsg',
          tabTitle: '模板消息',
        },
      },
      {
        path: '/sendrec',
        component: () => import('@/pages/InfoManagement/SendRecord'),
        meta: {
          isMenu: false,
          menuId: 'tmplmsg',
          tabId: 'tmplmsg',
          tabTitle: '模板消息',
        },
      },
    ],
  },

]

let routes = [
];

// eachRoutes(view)
function eachRoutes (data) {
  data.forEach(item => {
    if (item.path && item.component) {
      routes.push({
        path: item.path,
        name: item.name,
        component: item.component,
        meta: item.meta
      })
    }
    if (item.children) eachRoutes(item.children)
  })
}


let arr = [{
  name: 'home',
  path: '/home',
  component: Layout,
  redirect: '/home/index',
  /*meta:{
    title: '首页',
    fullPath: '/home'
  },*/
  children: routes

},]
export default arr

// export default view
// export default vRoutes
